package com.cong.stjdb.game;

import com.cong.stjdb.object.ComPuter;
import com.cong.stjdb.object.Person;
import com.cong.stjdb.service.GameStandardlmpl;
import lombok.extern.slf4j.Slf4j;

import java.util.Random;
import java.util.Scanner;
@Slf4j
public class PlayGames {
    public static void main(String[] args){
        //人--- 机  对战
        Person james = new Person();
        james.setName("james");
        Scanner input = new Scanner(System.in);
        james.person(input.nextInt());

        ComPuter comPuter1 =new ComPuter();
        comPuter1.setIp("");
        Random random=new Random();
        comPuter1.setNumber(random.nextInt(3));

        GameStandardlmpl standard = new GameStandardlmpl();

        // 对应人的输-赢-平，0-输，1-赢，2-平
        switch (standard.gameStandardOfperson(james.getBodylaguage(), comPuter1.getNumber())){
            case 0:
                log.info("你输给了电脑");
                break;
            case 1:
                log.info("你赢电脑");
                break;
            case 2:
                log.info("你与电脑打平局");
                break;
        }

    }
}
